9.7 Vectors
In Myron, composite values are used to represent points. It does not matter which of the composite types are used: radial, vector or complex[2]. The radial type represents the angle-magnitude form of a point and the vector type represents the coordinate form of a point. A complex value, being a composite type, represents a point in two-space. Operations appropriate for each composite type are provided as well as methods to convert between them.
In the discussion that follows, the terms vector and position vector are used in the mathematical sense and the terms vector and radial when used together with the qualifiers type and value refer to Myron types and values.
The plotter provides graphical representations of line segments and
position vectors by interpreting adjacent Myron vectors in a tuple
as line segments
and Myron vectors in a set as position vectors. Thus

Addition and subtraction of vectors also has a geometric
interpretation. The sum of the vectors

The simplicity of the vector expressions above belies behind-the scenes details.
9.7.1 Vector Addition
Addition and subtraction between two vector values are straightforward
applications of the rules for tuples with matching common types:
corresponding elements of a vector are added. Addition and subtraction
between two radial values uses conversion to and from intermediate vector
values. This means that addition of the innocuous looking

9.7.2 Scalar Multiplication
Multiplication of a line segment by a scalar changes both ends of the
line segment.
Using the radial type, a magnitude-angle pair is represented directly
by
9.7.3 Vector Multiplication
Multiplying two vectors produces a scalar using a dot-product operation. Syntactically, dot product is inferred for the multiplication operator when the left operand is a row vector and the right operand is a column vector. Thus



Vector multiplication is not defined for other combinations of vectors. Expressions with mixed operands are caught by the parser when the type of the result is important. If mixed vectors are required by some mathematical context, explicit casts can be used to specify conversions that conform to Myron's rules for vector multiplication.
Dot product should not be confused with the residual rule for tuples.
The tuple versions of the expressions above are
Applied to radial values, dot product uses an intermediate conversion
to vector values.
9.7.4 Mixing Vector Types
When a composite value is mixed with an operand of another type under addition or
subtraction, the type of the result is the “highest” type
of either operand according to the ordering radial, column, row, matrix.
The operand not of the highest type is
converted to the highest type before the operation is applied. Thus
If mixing composite types leads to uncertainty as to which automatic conversions are applied, explicit casts can be used to remove the uncertainty.
9.7.5 Vector Example
To exercise Myron's approach to vectors, consider the problem of
drawing 12 vectors each leading from the centre of a clock to the
numbers on its face. The vectors can be generated by the expression
